<?php
namespace catchAdmin\drug\tables\forms;

use catcher\library\form\Form;
use app\common\model\DrugType as TypeModel;

class Drug extends Form
{
    public function fields(): array
    {
        // TODO: Implement fields() method.
        return [
            self::select('type_value', '种类')->placeholder('请选择种类')->options(
                TypeModel::field(['value','label'])->select()->hidden(['id'])->toArray()
            ),
            self::input('name', '药品名称')->required(),
            self::input('specifications', '规格')->required(),
            self::textarea('indication', '适应症')->required(),
            self::textarea('dosage', '用法用量')->required(),
            self::textarea('reaction', '不良反应')->required(),
            self::textarea('taboo', '禁忌')->required(),
            self::textarea('note', '注意事项')->required(),
        ];
    }
}